<?php
/* 
 * Copyright (c) 2018-2021   All rights reserved.
 * 
 * 创建时间：2021-11-22 14:31
 *
 * 项目：rm  -  $  - import_list.php
 *
 * 作者：liwei 
 */

?>



<div class="page <?=\lev\base\Controllerv::$pageName?>" data-page="<?=\lev\base\Controllerv::$pageName?>">
    <?php Lev::navbarAdmin()?>

    <div class="page-content">
        <div class="page-content-inner">
            <div class="data-xtable card">
                <table>
                    <tr>
                        <th class="">表单名称/描述</th>
                        <th class="">字段详细</th>
                        <th class="wd100">操作</th>
                    </tr>
                    <?php foreach ($lists as $v): if (is_file($file = $v . '/formInfo.php')):?>
                    <?php $formInfo = include $file;?>
                    <?php $fields = is_file($file = $v . '/formFields.php') ? include $file : [];?>
                    <tr>
                        <td><?=$formInfo['name']?>
                            <p class="font12 scale9 transl">
                            <?=$formInfo['descs']?>
                            </p>
                        </td>
                        <td>
                            <b class="red"><?=$fcount = count($fields)?></b> 字段
                            <p class="font12 scale9 transl">
                                <?=$fcount ? implode(', ', array_keys($fields)) : ''?>
                            </p>
                        </td>
                        <td><a class="button-small button button-fill color-orange ajaxBtn wd30 wdmin" confirmmsg="此操作将全新创建一个表单及字段<br>不影响已有表单<br>你确定要执行吗？" href="<?=Lev::toReRoute(['admin-forms/import', 'imformid'=>$formInfo['id'], 'create'=>1])?>">导入</a></td>
                    </tr>
                    <?php endif; endforeach;?>
                </table>
            </div>
        </div>
    </div>

</div>
